<template>
	<view>
		<view style="margin-top: 20px;padding: 5px;padding-left: 20px;" class="box" v-for="item in recordData"
			@click="goReservationDetail(item.reservationId,item.doctorId)">
			<view style="display: flex;">
				<view>
					<image :src="item.doctorAvatar"
						style="width: 70px;height: 60px; margin-left: 2px;border-radius: 50%;"
						@click.native.stop="goDoctoerDetail(item.doctorId)">
				</view>
				<view style="flex: 8;">
					<view style="display: flex;gap: 10px;margin-left: 5px;font-size: 14px;">
						<view style="font-size: 18px;font-weight: bold;">{{item.patientName}}</view>
						<view style="margin-top: 3px;">{{item.staff }}</view>
						<view style="margin-top: 3px;">{{item.officeName}}</view>
					</view>
					<view
						style="display: flex;gap: 10px;margin-left: 5px;font-size: 13px;color: gray;margin-top: 4px;">
						<view>{{item.hospitalName}}</view>
						<view class="square-box">一甲</view>
					</view>
					<view
						style="display: flex;gap: 10px;margin-left: 5px;font-size: 13px;color: gray;margin-top: 2px;">
						<view>接诊率 <strong style="color: orange;margin-left: 10px;">99%</strong></view>
						<view>问诊疗 <strong style="color: orange;margin-left: 10px;">{{item.count}}</strong></view>
					</view>
				</view>
				<view style="flex: 5;">
					<button size="mini" type="primary" @click.native.stop="goTreatedDetail(item.id)"
						style="font-size: 14px;line-height: 20px;width: 50px;padding: 10px;">就诊详情</button>
					<button size="mini" type="primary" @click.native.stop="goCommentDetail(item.doctorId)"
						style="font-size: 14px;line-height: 20px;width: 50px;padding: 10px;margin-left: 5px;">就诊评价</button>
				</view>
			</view>
			<view class="square-box"
				style="background-color:#E1E1E1;border: 1px solid #E1E1E1;margin-top: 2px;width: 100%;padding: 2px;display: flex;">
				<image src="../../static/icons/已就诊.png" style="width: 50rpx;margin-top: 5px;margin-left: 4px;"
					mode="widthFix"></image>
				<view style="color: #FF8040;font-size: 15px;margin-top: 6px;margin-left: 4px;">
					就诊时间：{{item.recordData }}
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				recordData: {},
			}
		},
		onShow() {
			this.load()
		},
		methods: {
			load() {
				this.$request.get('/record/selectAll').then(res => {
					if (res.code === '200') {
						this.recordData = res.data;
					} else {
						this.$message.error(res.msg);
					}
				});
			},
			goTreatedDetail(recordId) {
				uni.navigateTo({
					url: '/pages/treatedDetail/treatedDetail?recordId=' + recordId
				})
			},
			goReservationDetail(reservationId, doctorId) {
				uni.navigateTo({
					url: `/pages/ReservationDetail/ReservationDetail?reservationId=${reservationId}&doctorId=${doctorId}`
				})
			},
			goDoctoerDetail(doctorId) {
				uni.navigateTo({
					url: '/pages/doctorDetail/doctorDetail?doctorId=' + doctorId
				})
			},
			goCommentDetail(doctorId) {
				uni.navigateTo({
					url: '/pages/commentDetail/commentDetail?doctorId=' + doctorId
				})
			},
			
		}
	}
</script>

<style>

</style>